<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: constant_expr&lt; T &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Compute Library
   &#160;<span id="projectnumber">18.05</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.xhtml"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.xhtml"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="inherits.xhtml"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.xhtml"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">constant_expr&lt; T &gt; Struct Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Constant expressions.  
 <a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="memItemLeft" align="right" valign="top">static constexpr T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">fixed_one</a> (uint8_t p)</td></tr>
<tr class="memdesc:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate representation of 1 in fixed point given a fixed point precision.  <a href="#a9c4b593f19fb9053fd52697eaa30c5d7">More...</a><br /></td></tr>
<tr class="separator:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a125e978e1d6df0f6d9f738b0c580f980"><td class="memItemLeft" align="right" valign="top">static constexpr float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">fixed_step</a> (uint8_t p)</td></tr>
<tr class="memdesc:a125e978e1d6df0f6d9f738b0c580f980"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate fixed point precision step given a fixed point precision.  <a href="#a125e978e1d6df0f6d9f738b0c580f980">More...</a><br /></td></tr>
<tr class="separator:a125e978e1d6df0f6d9f738b0c580f980"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a995c73a5ff995cc1b4c0c730892c792a"><td class="memItemLeft" align="right" valign="top">static constexpr float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a995c73a5ff995cc1b4c0c730892c792a">to_float</a> (T val, uint8_t p)</td></tr>
<tr class="memdesc:a995c73a5ff995cc1b4c0c730892c792a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a fixed point value to float given its precision.  <a href="#a995c73a5ff995cc1b4c0c730892c792a">More...</a><br /></td></tr>
<tr class="separator:a995c73a5ff995cc1b4c0c730892c792a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="memItemLeft" align="right" valign="top">static constexpr T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a918ab57096fdfe5e2cbf70de5145b9fa">to_int</a> (T val, uint8_t p)</td></tr>
<tr class="memdesc:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a fixed point value to integer given its precision.  <a href="#a918ab57096fdfe5e2cbf70de5145b9fa">More...</a><br /></td></tr>
<tr class="separator:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a682a2eb8869b48647719e194cbbcb4e1"><td class="memItemLeft" align="right" valign="top">static constexpr T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a682a2eb8869b48647719e194cbbcb4e1">to_fixed</a> (float val, uint8_t p)</td></tr>
<tr class="memdesc:a682a2eb8869b48647719e194cbbcb4e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a single precision floating point value to a fixed point representation given its precision.  <a href="#a682a2eb8869b48647719e194cbbcb4e1">More...</a><br /></td></tr>
<tr class="separator:a682a2eb8869b48647719e194cbbcb4e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a996cf0a2779076326d094ef9d75ddd1f"><td class="memItemLeft" align="right" valign="top">static constexpr T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a996cf0a2779076326d094ef9d75ddd1f">clamp</a> (T val, T <a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>, T <a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">max</a>)</td></tr>
<tr class="memdesc:a996cf0a2779076326d094ef9d75ddd1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clamp value between two ranges.  <a href="#a996cf0a2779076326d094ef9d75ddd1f">More...</a><br /></td></tr>
<tr class="separator:a996cf0a2779076326d094ef9d75ddd1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59cfd98dfc03fbc5540092aa196d7187"><td class="memTemplParams" colspan="2">template&lt;typename U &gt; </td></tr>
<tr class="memitem:a59cfd98dfc03fbc5540092aa196d7187"><td class="memTemplItemLeft" align="right" valign="top">static constexpr T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">saturate_cast</a> (U val)</td></tr>
<tr class="memdesc:a59cfd98dfc03fbc5540092aa196d7187"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saturate given number.  <a href="#a59cfd98dfc03fbc5540092aa196d7187">More...</a><br /></td></tr>
<tr class="separator:a59cfd98dfc03fbc5540092aa196d7187"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br />
struct arm_compute::test::fixed_point_arithmetic::detail::constant_expr&lt; T &gt;</h3>

<p>Constant expressions. </p>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00048">48</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a996cf0a2779076326d094ef9d75ddd1f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr T clamp </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Clamp value between two ranges. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to clamp </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">min</td><td>Minimum value to clamp to </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max</td><td>Maximum value to clamp to</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>clamped value </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00361">361</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>

<p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">arm_compute::test::fixed_point_arithmetic::detail::max()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">arm_compute::test::fixed_point_arithmetic::detail::min()</a>.</p>

<p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00511">functions::clamp()</a>.</p>
<div class="fragment"><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    {</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">std::min</a>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">std::max</a>(val, <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>), <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">max</a>);</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point&lt; T &gt; min(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">FixedPoint.h:897</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point&lt; T &gt; max(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">FixedPoint.h:902</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a9c4b593f19fb9053fd52697eaa30c5d7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr T fixed_one </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate representation of 1 in fixed point given a fixed point precision. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Representation of value 1 in fixed point. </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00305">305</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    {</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <span class="keywordflow">return</span> (1 &lt;&lt; p);</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    }</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a125e978e1d6df0f6d9f738b0c580f980"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr float fixed_step </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate fixed point precision step given a fixed point precision. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Fixed point precision step </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00315">315</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    {</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;        <span class="keywordflow">return</span> (1.0f / static_cast&lt;float&gt;(1 &lt;&lt; p));</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    }</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a59cfd98dfc03fbc5540092aa196d7187"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr T saturate_cast </td>
          <td>(</td>
          <td class="paramtype">U&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Saturate given number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to saturate</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Saturated value </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00372">372</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>

<p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">arm_compute::test::fixed_point_arithmetic::detail::max()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">arm_compute::test::fixed_point_arithmetic::detail::min()</a>, and <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::U</a>.</p>

<p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00540">functions::add()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00611">functions::div()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00110">fixed_point&lt; T &gt;::fixed_point()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00590">functions::mul()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00522">functions::negate()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00195">fixed_point&lt; T &gt;::operator fixed_point&lt; U &gt;()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00252">fixed_point&lt; T &gt;::rescale()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00639">functions::shift_left()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00565">functions::sub()</a>.</p>
<div class="fragment"><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    {</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(std::min&lt;U&gt;(std::max&lt;U&gt;(val, <span class="keyword">static_cast&lt;</span><a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a><span class="keyword">&gt;</span>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">std::numeric_limits&lt;T&gt;::min</a>())), <span class="keyword">static_cast&lt;</span><a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a><span class="keyword">&gt;</span>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">std::numeric_limits&lt;T&gt;::max</a>())));</div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point&lt; T &gt; min(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">FixedPoint.h:897</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::Channel::U</a></div><div class="ttdoc">Cb/U channel. </div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point&lt; T &gt; max(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">FixedPoint.h:902</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a682a2eb8869b48647719e194cbbcb4e1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr T to_fixed </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a single precision floating point value to a fixed point representation given its precision. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Floating point value </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The raw fixed point representation </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00349">349</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>

<p>References <a class="el" href="tests_2_utils_8h_source.xhtml#l00373">arm_compute::test::saturate_cast()</a>.</p>
<div class="fragment"><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    {</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">saturate_cast</a>&lt;<span class="keywordtype">float</span>&gt;(val * <a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">fixed_one</a>(p) + ((val &gt;= 0) ? 0.5 : -0.5)));</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    }</div><div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a9c4b593f19fb9053fd52697eaa30c5d7"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::fixed_one</a></div><div class="ttdeci">static constexpr T fixed_one(uint8_t p)</div><div class="ttdoc">Calculate representation of 1 in fixed point given a fixed point precision. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00305">FixedPoint.h:305</a></div></div>
<div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a59cfd98dfc03fbc5540092aa196d7187"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::saturate_cast</a></div><div class="ttdeci">static constexpr T saturate_cast(U val)</div><div class="ttdoc">Saturate given number. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00372">FixedPoint.h:372</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a995c73a5ff995cc1b4c0c730892c792a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr float to_float </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a fixed point value to float given its precision. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Fixed point value </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Float representation of the fixed point number </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00327">327</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>

<p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00177">fixed_point&lt; T &gt;::operator float()</a>.</p>
<div class="fragment"><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    {</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(val * <a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">fixed_step</a>(p));</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    }</div><div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a125e978e1d6df0f6d9f738b0c580f980"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::fixed_step</a></div><div class="ttdeci">static constexpr float fixed_step(uint8_t p)</div><div class="ttdoc">Calculate fixed point precision step given a fixed point precision. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00315">FixedPoint.h:315</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a918ab57096fdfe5e2cbf70de5145b9fa"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static constexpr T to_int </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a fixed point value to integer given its precision. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Fixed point value </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Integer of the fixed point number </dd></dl>

<p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00338">338</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>

<p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00728">functions::exp()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00186">fixed_point&lt; T &gt;::operator U()</a>.</p>
<div class="fragment"><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    {</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        <span class="keywordflow">return</span> val &gt;&gt; p;</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    }</div></div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>tests/validation/<a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test.xhtml">test</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic.xhtml">fixed_point_arithmetic</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml">detail</a></li><li class="navelem"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml">constant_expr</a></li>
    <li class="footer">Generated on Wed May 23 2018 11:36:44 for Compute Library by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
